unit worldI;

interface
uses VectorGeometry, ScriptEngineI;
const
WorldGUID:TGUID = '{F4A59290-B37C-4BB9-B036-8305876C21EB}';
type TGeometricalPrimitiveType=(GP_AABB, GP_OBB, GP_SPHERE, GP_RAY, GP_POINT);
type TGeometricalPrimitive=packed record
_type:TGeometricalPrimitiveType;
orientation:TAffineMatrix;
case TGeometricalPrimitiveType of
GP_AABB, GP_OBB: (Size:TVector3F; minVert,maxVert:TVector3F);
GP_Sphere: (radius:single);
GP_RAY: (startPoint:TVector3F; direction:TVector3F; length:single);
end;
const
CollisionThreshold = 0.05;
Type IWorld=^_World;
_World = packed record
Init:procedure(const size:single; AmbientReverb:PChar; gravity:TVector3F); cdecl;
Release:procedure(ReleaseUnmanaged:boolean=false); cdecl;
PushGameEvent:Procedure(obj:pointer; code:cardinal; data:pointer); cdecl;
end;
type PGameEvent=^TGameEvent;
TGameEvent=packed record
obj:pointer;
code:cardinal;
data:pointer;
end;
//World specific events (do not use with Core_RegisterEventHandler!)
const
WORLDEVENT_Min = $80000;
WORLDEVENT_COLLISION= WORLDEVENT_Min + 1;
WORLDEVENT_TIMER = WORLDEVENT_MIN + 2;
WORLDEVENT_STARTFREEFALL = WORLDEVENT_MIN + 3;
WORLDEVENT_ENDFREEFALL = WORLDEVENT_MIN + 4;
implementation

end.
